﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Middleware.ApiTest.Models
{
    /// <summary>
    /// 商品信息表
    /// </summary>
    public class OrderItems
    {
        [Key]
        public Guid Id { get; set; } = Guid.NewGuid();

        [Required]
        public Guid ProductId { get; set; }

        [Required]
        [MaxLength(255)]
        public string ProductName { get; set; }

        [MaxLength(50)]
        public string SkuCode { get; set; }      // 商品SKU

        [Required]
        [Column(TypeName = "decimal(10, 2)")]
        public decimal UnitPrice { get; set; }   // 下单时的单价

        [Required]
        public int Quantity { get; set; } = 1;

    }
}
